package com.ifgostudio.framework.repository.support;

import java.io.Serializable;  

import javax.persistence.EntityManager;  
  
import org.springframework.data.jpa.repository.support.JpaEntityInformation;  
import org.springframework.data.jpa.repository.support.SimpleJpaRepository;  
import org.springframework.data.repository.NoRepositoryBean;  

import com.ifgostudio.framework.repository.BaseJpaRepository;

/**
 * 定义全局扩展Repository，可以扩展全局的自定义方法  
 * @author Wangjk
 * @Version 1.0
 * @Date 2013-3-22
 * @param <T> 实体类型
 * @param <ID> 主键类型
 */
@NoRepositoryBean  
public class JpaRepositorySupport<T, ID extends Serializable> extends SimpleJpaRepository<T, ID>  implements BaseJpaRepository<T, ID> {  
    
	
	@SuppressWarnings("unused")
	private final EntityManager entityManager;
	
	public JpaRepositorySupport(Class<T> domainClass, EntityManager em) {  
	        super(domainClass, em);  
	        entityManager = em;
	    }  
	  
	public JpaRepositorySupport(final JpaEntityInformation<T, ?> entityInformation, final EntityManager entityManager) {  
	    super(entityInformation, entityManager);  
	    this.entityManager = entityManager;
	}

}
